-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-27593] Add docs for legacy mail service #6513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6513 +/- ##
=======================================
Coverage 52.27% 52.27%
=======================================
Files 1909 1909
Lines 84598 84598
Branches 7558 7558
=======================================
Hits 44223 44223
Misses 38659 38659
Partials 1716 1716 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Claude finished @trmartin4's task —— View job Code Review CompleteI've completed a comprehensive review of this PR. The changes look solid overall - this is a well-executed refactoring that improves code organization and adds important documentation. Below are my findings: Summary of ChangesThis PR reorganizes mail-related services into a dedicated
Critical Issues FoundNone identified. Suggested Improvements1. README Documentation - Minor Clarity IssuesLocation: Issue: Character encoding issue in the text template example � {{ CurrentYear }} Bitwarden Inc.Suggestion: Replace 2. Deprecation Attributes - Consider Adding More ContextLocations:
Current: [Obsolete("The IMailService has been deprecated in favor of the IMailer. All new emails should be sent with an IMailer implementation.")]Suggestion: Consider adding a URL parameter to direct developers to migration docs: [Obsolete("The IMailService has been deprecated in favor of the IMailer. All new emails should be sent with an IMailer implementation.", DiagnosticId = "BW0001", UrlFormat = "https://contributing.bitwarden.com/architecture/server/mail")]This provides IDE integration and easier access to migration guidance. 3. README - Disk Override Documentation Could Be More ProminentLocation: Current: The critical warning about backward compatibility for disk overrides is at the bottom of a long README. Suggestion: Consider adding a warning callout at the top of the README or in a separate 4. Namespace Consistency - Minor InconsistencyObservation: The PR description mentions keeping
Suggestion: This is acceptable given the deprecated status, but consider adding a TODO comment in the deprecated classes: // TODO: When removing this deprecated service, also clean up the namespace inconsistency
// This service lives in Platform/Mail but uses the Services namespace to avoid breaking 100+ files5. Service Registration - Good Practice ObservedLocation: Observation: Excellent separation of concerns with clear comments: // Legacy mailer service
services.AddSingleton<IMailService, HandlebarsMailService>();
// Modern mailers
services.AddMailer();This makes the migration path very clear. Well done! 👍 Good Practices Observed
Security & Performance Considerations✅ Security: No security concerns identified. The changes are purely organizational with no modifications to mail content handling or sensitive data processing. ✅ Performance: No performance impact. This is a refactoring with no changes to execution logic. ✅ Zero-knowledge compliance: No impact on vault data or encryption. Mail services handle only metadata and notifications. Action Items for Author
VerdictThis is a well-executed refactoring that significantly improves code organization and documentation. The approach of moving files while maintaining backward compatibility is pragmatic and minimizes risk. The only required change is the minor README encoding fix. Recommendation: ✅ Approve after addressing the character encoding issue |
| @@ -1,5 +1,5 @@ | |||
| using Bit.Core.Models.Mail; | |||
| using Bit.Core.Services; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does mailer go to it's own namespace and not just in ..Services.Mail, for example?
BTreston
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the dotnet format changes 👍


🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-27593
📔 Objective
We would like to document that the
HandlebarsMailServicehas been deprecated in favor of theMailer, and also add documentation in code about the support guarantees of our disk overrides of mail templates, so that there is no confusion in the future about this feature and its expectations.Creating a "home" for the documentation that made sense required moving the mail-related services out of the shared
Servicesfolder and into their own "feature" folder. This is our current best practice and allows contextual, close-to-codeREADMEs for developer and AI usage.With this change:
Mailfolder.Platform.Mailnamespace, with the exception of the deprecatedIMailServiceandHandlebarsMailService. These were not moved fromServicesbecause it would introduce more than 100 files to the PR.READMEat theMailfolder level.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes